/*=========================================================================
project:       Bullets for Ballots
Author:        Aila Matanock
Dependencies:  UC Berkeley
---------------------------------------------------------------------------
Creation Date: 2012      
Modification Date: 3/23/2017  
Do-file version: 5   
References: Initial data universe drawn from UCDP Peace Agreement Dataset (modified); master data are in F1975Bookmergedplus@5.dta         
Output: Models and graphs
===========================================================================*/

use Matanock_Bullets for Ballots_Replication Data 4-19-17.dta, clear


*=======Figure 1. Peace Endurance across Peace Agreements (Kaplan-Meier Estimates)=======*

replace f10=0 if f10==1 & censored==1

stset mbreak, failure(f10)
stdes
su mbreak, d

sts graph, survival by(propartNC) title("") ytitle(Survival of Peace) xtitle(Months after the Peace Agreement) legend(size(small) label(1 "Without Participation Provisions") label(2 "With Participation Provisions") ring(1))


*=======Table 2. Conflict Recurrence after Peace Agreements (Logistic Regression)=======*

*Model 1
logit failure propart, cluster(ccode)

*Model 2
logit failure propart##coldwar, cluster(ccode)


*=======Figure 2. Predicted Probabilities of Conflict Recurrence (Monitoring)=======*

logit failure propart##c.nexlem, cluster(ccode)
quietly margins, at(nexlem==(0(.1)1)) over(propart)
marginsplot, l(90) title("Predicted Probabilities of Conflict Recurrence (Monitoring)") xtitle("Regional Election Observation (Percent, Lagged)") ytitle("Probability of Conflict Recurrence (5 Years)") plot2opts(msymbol(D)) legend(size(3)) addplot(histogram nexlem, below fraction fintensity(inten10) lcolor(white) fcolor(eltblue) legend(order(1 "90% confidence intervals" 3 "Without Participation Provisions" 4 "With Participation Provisions" 5 "Fraction of Observations") size(3))) scheme(s1mono)


*=======Figure 3. Predicted Probabilities of Conflict Recurrence (Conditional Incentives)=======*

logit failure propart##c.regdg, cluster(ccode)
quietly margins, at(regdg==(0(0.01)0.20)) over(propart)
marginsplot, l(90) title("Predicted Probabilities of Conflict Recurrence (Conditional Incentives)") xtitle("Regional Democracy and Governance Assistance""(Percent Development Aid, Lagged 2 Year Av.)") ytitle("Probability of Conflict Recurrence (5 Years)") plot2opts(msymbol(D)) legend(size(3)) addplot(histogram regdg, fraction fintensity(inten10) lcolor(white) fcolor(eltblue) legend(order(1 "90% confidence intervals" 3 "Without Participation Provisions" 4 "With Participation Provisions" 5 "Fraction of Observations") size(3)) below) scheme(s1mono)










